/*
 * protconst.h
 *
 * Created: 18.09.2013 23:47:47
 *  Author: evgen
 */ 

#ifndef PROTCONST_H_
#define PROTCONST_H_
////////////////////////////////////////////////////////////////
// input system commands
#define PING_CMD				1		// [head, len, cnt]
#define STAT_CMD				2		// [head, len, cnt]
#define VERSION_CMD				3		// [head, len, cnt]

// dvg params
#define WRITE_DVGPRM_EEPROM_CMD	4
#define LOAD_DVGPRM_EEPROM_CMD	5
#define SET_DVGPRM_EEPROM_CMD	6
#define GET_DVGPRM_EEPROM_CMD	7

#define SETDVG_CMD              8		// [head, len, cnt, idx, VALUE]	set drive value
#define RSTDVG_CMD				9		// [head, len, cnt, idx]
#define WINDDVG_CMD				10		// [head, len, cnt, idx, value]
#define CALIBDVG_CMD			11		// [head, len, cnt, idx]

// encoder params
#define GETENC_CMD              12		// [head, len, cnt, idx]
#define RSTENC_CMD              13		// [head, len, cnt, idx]
#define SETENCMODE_CMD          14		// [head, len, cnt, mode]
#define GETENCMODE_CMD          15		// [head, len, cnt]

/////////////////////////////////////////////
// packet lengths
#define PING_CMD_LEN				3		// [head, len, cnt]
#define STAT_CMD_LEN				3		// [head, len, cnt]
#define VERSION_CMD_LEN				3		// [head, len, cnt]
#define FLASH_PARAMS_CMD_LEN		4		// [head, len, cnt, idx]

// dvg params
#define SETDVG_CMD_LEN              5		// [head, len, cnt, idx, VALUE]	set drive value
#define RSTDVG_CMD_LEN				4		// [head, len, cnt, idx]
#define WINDDVG_CMD_LEN				4		// [head, len, cnt, idx]
#define CALIBDVG_CMD_LEN			4		// [head, len, cnt, idx]

// encoder params
#define GETENC_CMD_LEN              4		// [head, len, cnt, idx]
#define RSTENC_CMD_LEN              4		// [head, len, cnt, idx]
#define SETENCMODE_CMD_LEN          4		// [head, len, cnt, mode]
#define GETENCMODE_CMD_LEN          3		// [head, len, cnt]

////////////////////////////////////////////////////////////////
// output system commands
// system commands
#define PING_ACK_CMD				1		// [head, len, cnt]
#define STAT_ACK_CMD				2
#define VERSION_ACK_CMD				3

#define GETENC_ACK_CMD              4		// [head, len, cnt, idx, enc0, enc1, enc2, enc3]
// [head, len, cnt, enc00, enc01, enc02, enc03, enc10, enc11, enc12, enc13]

// drive commands
#define GET_DVGPRM_ACK_CMD		5
// encoder commands

#define PING_ACK_CMD_LEN		0x3
#define STAT_ACK_CMD_LEN		0x7
#define VERSION_ACK_CMD_LEN		0x3


#endif /* PROTCONST_H_ */
